function setCookie(e, s, t) {
  $.cookie(e, s, {
    expires: t || 30,
    domain: "banksteel.com",
    path: "/"
  })
}

function getCookie(e) {
  return $.cookie(e) || ""
}
$(function () {
  var e = $("body"),
    s = !0,
    t = getCookie("browse_index_time"),
    n = getCookie("browse_res_time"),
    i = getCookie("browse_shop_time"),
    o = getCookie("browse_buyer_time"),
    c = getCookie("browse_seller_time"),
    a = getCookie("browse_zdzc_time"),
    l = '<span class="prev next-close">稍后查看</span><span class="next open-more">继续探索</span>',
    p = introJs();
  e.hasClass("page-index") ? (t ? 3 <= t ? s = !1 : setCookie("browse_index_time", ++t, 365) : setCookie("browse_index_time", t = 1, 365), t && n && a && (l = '<span class="prev next-close">立即体验</span>'), $("#step_index5").is(":visible"), p.setOptions({
    tooltipClass: "guide-wrap",
    exitOnOverlayClick: !1,
    steps: []
  }), s && ($("body").append('<div class="guide-wrap guide-wrap-start"><div class="step-content step-content1"><div class="conten"><div class="tit">主人，平台上线采购新功能‘终端直采’，实时商机在等您，快来看啦！</div></div><i class="close"></i><div class="btn-content"><span class="prev">稍后查看</span><span class="next">立即查看</span></div></div></div>'), $(".guide-wrap-start").show())) : e.hasClass("page-shop") ? (i ? 3 <= i ? s = !1 : setCookie("browse_shop_time", 3, 365) : (setCookie("browse_shop_time", 3, 365), i = 1), t && n && i && o && c && (l = '<span class="prev next-close">立即体验</span>'), p.setOptions({
    tooltipClass: "guide-wrap",
    exitOnOverlayClick: !1,
    steps: [{
      element: document.querySelector("#step_shop1"),
      intro: '<div class="step-content step-content4"><div class="conten"><div class="tit">如果对这家店铺感兴趣，记得关注哟</div></div><i class="close"></i><div class="btn-content"><span class="prev btn-prev grey">上一步</span><span class="next btn-next">下一步</span></div></div>',
      position: "bottom"
    }, {
      element: document.querySelector("#step_shop2"),
      intro: '<div class="step-content step-content4"><div class="conten"><div class="tit">这是店长热推资源，建议重点关注哟</div></div><i class="close"></i><div class="btn-content">' + l + "</div></div>",
      position: "bottom"
    }]
  }), 0 == $(".error-head").length && s && p.start()) : e.hasClass("page-res") ? (n ? 3 <= n ? s = !1 : setCookie("browse_res_time", 3, 365) : (n = 1, setCookie("browse_res_time", 3, 365)), t && n && i && o && c && (l = '<span class="prev next-close">立即体验</span>'), 0 < $("#slideBox .ad-right-list .ad-link").length ? p.setOptions({
    tooltipClass: "guide-wrap",
    exitOnOverlayClick: !1,
    steps: [{
      element: document.querySelector("#step_res1"),
      intro: '<div class="step-content step-content4"><div class="conten"><div class="tit">筛选功能升级，找货只需轻轻点几下</div></div><i class="close"></i><div class="btn-content"><span class="prev btn-prev grey">上一步</span><span class="next btn-next">下一步</span></div></div>',
      position: "bottom"
    }, {
      element: document.querySelector("#step_res2"),
      intro: '<div class="step-content step-content4"><div class="conten"><div class="tit">资源信息新增资源图片，告别单调的表格式展示</div></div><i class="close"></i><div class="btn-content"><span class="prev btn-prev">上一步</span><span class="next btn-next">下一步</span></div></div>',
      position: "bottom"
    }, {
      element: document.querySelector("#step_res3"),
      intro: '<div class="step-content step-content4"><div class="conten"><div class="tit">遇到感兴趣的资源，立即收藏起来吧</div></div><i class="close"></i><div class="btn-content"><span class="prev btn-prev">上一步</span><span class="next btn-next">下一步</span></div></div>',
      position: "bottom"
    }, {
      element: document.querySelector("#step_res4"),
      intro: '<div class="step-content step-content4"><div class="conten"><div class="tit">新增收藏夹，让你便捷管理收藏内容</div></div><i class="close"></i><div class="btn-content"><span class="prev btn-prev">上一步</span><span class="next btn-next">下一步</span></div></div>',
      position: "bottom"
    }, {
      element: document.querySelector("#slideBox"),
      intro: '<div class="step-content step-content4"><div class="conten"><div class="tit">优质推荐商家等你来</div></div><i class="close"></i><div class="btn-content">' + l + "</div></div>",
      position: "left"
    }]
  }) : p.setOptions({
    tooltipClass: "guide-wrap",
    exitOnOverlayClick: !1,
    steps: [{
      element: document.querySelector("#step_res1"),
      intro: '<div class="step-content step-content4"><div class="conten"><div class="tit">筛选功能升级，找货只需轻轻点几下</div></div><i class="close"></i><div class="btn-content"><span class="prev btn-prev grey">上一步</span><span class="next btn-next">下一步</span></div></div>',
      position: "bottom"
    }, {
      element: document.querySelector("#step_res2"),
      intro: '<div class="step-content step-content4"><div class="conten"><div class="tit">资源信息新增资源图片，告别单调的表格式展示</div></div><i class="close"></i><div class="btn-content"><span class="prev btn-prev">上一步</span><span class="next btn-next">下一步</span></div></div>',
      position: "bottom"
    }, {
      element: document.querySelector("#step_res3"),
      intro: '<div class="step-content step-content4"><div class="conten"><div class="tit">遇到感兴趣的资源，立即收藏起来吧</div></div><i class="close"></i><div class="btn-content"><span class="prev btn-prev">上一步</span><span class="next btn-next">下一步</span></div></div>',
      position: "bottom"
    }, {
      element: document.querySelector("#step_res4"),
      intro: '<div class="step-content step-content4"><div class="conten"><div class="tit">新增收藏夹，让你便捷管理收藏内容</div></div><i class="close"></i><div class="btn-content">' + l + "</div></div>",
      position: "bottom"
    }]
  }), s && (p.start(), p.onafterchange(function (e) {
    "slideBox" == $(e).attr("id") && setTimeout(function () {
      $("html,body").animate({
        scrollTop: $("#slideBox .r-tit").offset().top - 200
      }, 100)
    }, 500)
  }))) : e.hasClass("page-buyer") ? (o ? 3 <= o ? s = !1 : setCookie("browse_buyer_time", ++o, 365) : setCookie("browse_buyer_time", o = 1, 365), t && n && i && o && c && (l = '<span class="prev next-close">立即体验</span>'), p.setOptions({
    tooltipClass: "guide-wrap",
    exitOnOverlayClick: !1,
    steps: [{
      element: document.querySelector("#step_buyer1"),
      intro: '<div class="step-content step-content4"><div class="conten"><div class="tit">求购单管理优化，查看更方便</div></div><i class="close"></i><div class="btn-content"><span class="prev btn-prev grey">上一步</span><span class="next btn-next">下一步</span></div></div>',
      position: "right"
    }, {
      element: document.querySelector("#step_buyer2"),
      intro: '<div class="step-content step-content4"><div class="conten"><div class="tit">撮合商城中“我想买”的意向订单，可在这统一管理</div></div><i class="close"></i><div class="btn-content"><span class="prev btn-prev">上一步</span><span class="next btn-next">下一步</span></div></div>',
      position: "right"
    }, {
      element: document.querySelector("#step_buyer3"),
      intro: '<div class="step-content step-content4"><div class="conten"><div class="tit">你感兴趣的资源和店铺，均可在这便捷管理</div></div><i class="close"></i><div class="btn-content">' + l + "</div></div>",
      position: "right"
    }]
  }), s && ($("body").append('<div class="guide-wrap guide-wrap-start"><div class="step-content step-content1"><div class="conten"><div class="tit">买家中心更新啦，一起来看看吧</div></div><i class="close"></i><div class="btn-content"><span class="prev">稍后查看</span><span class="next">立即探索</span></div></div></div>'), $(".guide-wrap-start").show())) : e.hasClass("page-seller") ? (c ? 3 <= c ? s = !1 : setCookie("browse_seller_time", ++c, 365) : setCookie("browse_seller_time", c = 1, 365), t && n && i && o && c && (l = '<span class="prev next-close">立即体验</span>'), p.setOptions({
    tooltipClass: "guide-wrap",
    exitOnOverlayClick: !1,
    steps: [{
      element: document.querySelector("#step_seller1"),
      intro: '<div class="step-content step-content4"><div class="conten"><div class="tit">快捷发布，支持多种资源类型统一管理</div></div><i class="close"></i><div class="btn-content"><span class="prev btn-prev grey">上一步</span><span class="next btn-next">下一步</span></div></div>',
      position: "right"
    }, {
      element: document.querySelector("#step_seller2"),
      intro: '<div class="step-content step-content4"><div class="conten"><div class="tit">来自撮合商城的意向订单，均可在这统一管理</div></div><i class="close"></i><div class="btn-content"><span class="prev btn-prev">上一步</span><span class="next btn-next">下一步</span></div></div>',
      position: "right"
    }, {
      element: document.querySelector("#step_seller3"),
      intro: '<div class="step-content step-content4"><div class="conten"><div class="tit">买家求购精准推送，您可在线快速报价</div></div><i class="close"></i><div class="btn-content"><span class="prev btn-prev">上一步</span><span class="next btn-next">下一步</span></div></div>',
      position: "right"
    }, {
      element: document.querySelector("#step_seller4"),
      intro: '<div class="step-content step-content4"><div class="conten"><div class="tit">完善资料，让买家更快找到您</div></div><i class="close"></i><div class="btn-content">' + l + "</div></div>",
      position: "right"
    }]
  }), s && ($("body").append('<div class="guide-wrap guide-wrap-start"><div class="step-content step-content1"><div class="conten"><div class="tit">卖家中心更新啦，一起来看看吧</div></div><i class="close"></i><div class="btn-content"><span class="prev">稍后查看</span><span class="next">立即探索</span></div></div></div>'), $(".guide-wrap-start").show())) : e.hasClass("page-zc") && (a ? 3 <= a ? s = !1 : setCookie("browse_zdzc_time", ++a, 365) : setCookie("browse_zdzc_time", a = 1, 365), t && n && a && (l = '<span class="prev next-close">立即体验</span>'), p.setOptions({
    tooltipClass: "guide-wrap",
    exitOnOverlayClick: !1,
    steps: []
  }), s) && ($("body").append('<div class="guide-wrap guide-wrap-start"><div class="step-content step-content1"><div class="conten"><div class="tit">欢迎来到‘终端直采”专区！这儿的采购计划，您可以自由报价哟！</div></div><i class="close"></i><div class="btn-content"><span class="prev">立即报价</span><span class="next">了解更多</span></div></div></div>'), $(".guide-wrap-start").show()), $(document).on("click", ".page-index .step-content .open-more", function () {
    window.location.href = "//res.banksteel.com"
  }), $(document).on("click", ".page-res .step-content .open-more", function () {
    window.location.href = "//shop.banksteel.com/70"
  }), $(document).on("click", ".page-shop .step-content .open-more", function () {
    window.location.href = "//member.banksteel.com/console/#/buyer/contract-list"
  }), $(document).on("click", ".page-buyer .step-content .open-more", function () {
    window.location.href = "//member.banksteel.com/pop/member/index.htm"
  }), $(document).on("click", ".page-seller .step-content .open-more", function () {
    window.location.href = "//www.banksteel.com"
  }), $(".guide-wrap-start .next").click(function () {
    $(".guide-wrap-start").hide(), window.location.href = "//supplychain.banksteel.com/zhicai", e.hasClass("page-index") && setCookie("browse_index_time", 3, 365), e.hasClass("page-zc") && ($(".guide-wrap-start").hide(), window.location.href = "//www.banksteel.com/active/zdzc2021/index.html", setCookie("browse_zdzc_time", 3, 365))
  }), $(".guide-wrap-start .prev").click(function () {
    $(".guide-wrap-start").hide(), p.exit()
  }), $(document).on("click", ".step-content .close", function () {
    $(".guide-wrap-start").hide(), p.exit()
  }), $(document).on("click", ".step-content .next-close", function () {
    p.exit()
  }), $(document).on("click", ".introjs-tooltip .btn-next", function () {
    p.nextStep()
  }), $(document).on("click", ".introjs-tooltip .btn-prev", function () {
    p.previousStep()
  })
});
